package com.homework8_3;

import com.sun.xml.internal.bind.v2.model.core.ID;
import hfjava.Student;

public class Students implements Comparable {
    private String name;
    private int age;
    private String ID;
    private double score;

    public Students(String name, int age, String ID, double score) {
        this.name = name;
        this.age = age;
        this.ID = ID;
        this.score = score;
    }

    public Students() {
    }

    public void setID(String ID) {
        this.ID = ID;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getID() {
        return ID;
    }

public int  compareTo(Object obj){
    Students students=(Students)obj;
    if (this.score<students.getScore()){
        return -1;
    }else if (this.score>students.getScore()){
        return 1;
    }
    return 0;
}

}
